﻿@model IEnumerable<ECGadmin.Common.ProductTypicalAttributeDto>
<div class="box-Info" style="display: none;">
    <div class="Info-header">
        <span>Thuộc tính riêng</span>
    </div>
    <div class="Info-body ib-infoseo">
        <table class="p-att-info table-odd table-plist">
            <tr class="psize-title">
                <th>Tên</th>
                <th>Mô tả</th>
                <th>Thứ tự</th>
                <th>Hiển Thị</th>
                <th>Update</th>
            </tr>
            @foreach (var item in Model)
            {
                <tr class="@string.Format("tr-pt-{0}", item.Id)">
                    <input type="hidden" value="@item.Id" class="hidTypicalAttId" />
                    <input type="hidden" value="@item.CreatedDate" class="hidTypicalAttCreateDate" />
                    <input type="hidden" value="@item.ProductId" class="hidTypicalAttProductId" />
                    <td class="p-att-name">@item.Name</td>
                    <td class="p-att-description">@item.Description</td>
                    <td class="p-att-ordering">@item.Ordering</td>
                    <td>
                        <input type="checkbox" class="pTypicalAttShowInfo" @string.Format("{0}", item.Show ? "checked" : "") />
                    </td>
                    <td>
                        <a href="javascript:void(0);" onclick="EditTypicalAtt(@item.Id)">Sửa</a> |
                        <a href="javascript:void(0);" onclick="DeleteTypicalAtt(@item.Id)">Xóa</a>
                    </td>
                </tr>
            }
        </table>
        
        <table class="table-info">
            <tr>
                <td class="tInfoLeft">
                    Tên
                </td>
                <td class="tInfoRight">
                    @Html.TextBox("pTypicalAttName")
                </td>
            </tr>
            <tr>
                <td class="tInfoLeft">
                    Mô tả
                </td>
                <td class="tInfoRight">
                    @Html.TextBox("pTypicalAttDescription")
                </td>
            </tr>
            <tr>
                <td class="tInfoLeft">
                    Thứ tự
                </td>
                <td class="tInfoRight">
                    @Html.TextBox("pTypicalAttOrder")
                </td>
            </tr>
            <tr>
                <td class="tInfoLeft">
                    Hiển thị
                </td>
                <td class="tInfoRight">
                    @Html.CheckBox("pTypicalAttShow", true, new { @Class = "typicalAttShow" })
                </td>
            </tr>
            <tr>
                <td class="tInfoLeft">
                </td>
                <td class="tInfoRight">
                    <input type="button" value="Tạo thuộc tính" onclick="CreateTypicalAttribute(@ViewBag.ProductId)" id="btnCreateTypicalAtt"/>
                    <input type="button" value="Cập nhật" id="btnUpdateTypicalAtt" style="display: none;" />
                </td>
            </tr>
        </table>
    </div>
</div>
